﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Bussiness;

namespace EWebsite
{
    public partial class Product : System.Web.UI.Page
    {
        private DataTable _tblProduct;

        public DataTable TblProduct {
            get { return _tblProduct; }
            set { _tblProduct = value; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) {
                int productID = -1;
                try {
                    productID = int.Parse(Request["p"]);
                }
                catch (Exception ex) { }

                if (productID > 0) {
                    ProductBuss buss = new ProductBuss();
                    _tblProduct = buss.getProduct(productID);
                }
                else {
                    Response.Redirect("Default.aspx");
                }
            }
        }
    }
}